<%-- 
    Document   : edituseraccount
    Created on : May 4, 2012, 3:24:57 PM
    Author     : Jayson Kiong
--%>

<%@page import="Model.User"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Edit User Account</title>
        <link rel = "stylesheet" type = "text/css" href = "quicklendstyle.css"/>
        <script src="gen_validatorv4.js" type="text/javascript"></script>
        
    </head>
    <body>
        <%User user = (User)session.getAttribute("user");
        %>
            <div id="contenttitle" style="position: absolute; top:13px; left:25px;">
            Edit User Account
            </div>
        <form id="editaccountform" action="EditAccountServlet" method="POST">
            <table id="editcontent"style="position:absolute; top:70px; left:30px; filter:alpha(opacity=100)">
            
                <tr>
                    <td>Last Name:</td><td><input type="text" name="lastname" value="<%=user.getStrLastname()%>" ><div id='editaccountform_lastname_errorloc' style="color:#FF0000"></div></td>
                </tr>
                <tr>
                    <td>First Name:</td><td><input type="text" name="firstname" value="<%=user.getStrFirstname()%>"><div id='editaccountform_firstname_errorloc' style="color:#FF0000"></div></td>
                </tr>
                <tr>
                    <td>Middle Name:</td><td><input type="text" name="middlename" value="<%=user.getStrMiddlename()%>"><div id='editaccountform_middlename_errorloc' style="color:#FF0000"></div></td>
                </tr>
                <tr>
                    <td>Contact No.</td><td><input type="text" name="contact"value="<%=user.getStrContactno()%>"><div id='editaccountform_contact_errorloc' style="color:#FF0000"></div></td>
                </tr>
                <tr>
                    <td></br></td>
                </tr>
                <tr>
                    <td>Username:</td><td><input type="text" name="username" value="<%=user.getStrUsername()%>"><div id='editaccountform_username_errorloc' style="color:#FF0000"></div></td>
                </tr>
                <tr>
                   <td><input type="hidden" style="width:150px;" name="id" value="<%=user.getiUserid()%>"></td>
                </tr>
                
                <tr>
                    <td></br></td>
                </tr>
                <tr>
                    <td>*All fields are required</td>
                </tr>
                
                    
            </table>
             <div id="edituserfunction" style="position:absolute;top:550px;left:450px;">
                <input type="image" src="images/saveimage.png" size="13" style="position:absolute; left:0px"/>
                <a href="#" class="precompcancelbtn" name="precompcancelbtn"  size="13" style="position:absolute; left:170px"/></a>     
            </div>
        </form>
    </body>
    <script type="text/javascript">
         var frmvalidator  = new Validator("editaccountform");
         frmvalidator.addValidation("firstname","req","Please enter your First Name");
         frmvalidator.addValidation("firstname","alpha_s","Invalid First Name");
         frmvalidator.addValidation("lastname","req","Please enter your Last Name");
         frmvalidator.addValidation("lastname","alpha_s","Invalid Last Name");
         frmvalidator.addValidation("middlename","req","Please enter your Middle Name");
         frmvalidator.addValidation("middlename","alpha_s","Invalid Middle Name");
         frmvalidator.addValidation("contact","req","Please enter the Contact No.");
         frmvalidator.addValidation("contact","num","Invalid Contact No.");
         frmvalidator.addValidation("username","req","Please enter the Username");
         frmvalidator.EnableOnPageErrorDisplay();
         frmvalidator.EnableMsgsTogether();
    </script>
</html>
